package main

import (
	"google.golang.org/grpc"
	"google.golang.org/grpc/keepalive"
	"grpcServer/helper"
	"grpcServer/services"
	"log"
	"net"
	"time"
)

func main() {
	rpcServer := grpc.NewServer(grpc.Creds(helper.GetServerCreds()),grpc.KeepaliveParams(keepalive.ServerParameters{
		MaxConnectionIdle: 5*time.Minute,
	}))
	services.RegisterProdServiceServer(rpcServer, new(services.ProdService))
	lis, err := net.Listen("tcp",":8081")
	if err != nil{
		log.Fatal(err)
	}
	rpcServer.Serve(lis)
}
